package de.tum.bluebook;

import java.awt.EventQueue;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.BorderLayout;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JCheckBox;
import javax.swing.JTextField;
import javax.swing.JPanel;
import java.awt.SystemColor;
import javax.swing.JButton;
import javax.swing.JTextPane;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;

public class Bluebook {

	private JFrame frame;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Bluebook window = new Bluebook();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public Bluebook() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.getContentPane().setBackground(Color.WHITE);
		frame.setBounds(100, 100, 536, 469);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JLabel logoLabel = new JLabel("");
		logoLabel.setIcon(new ImageIcon(Bluebook.class.getResource("/ressources/tum-logo.png")));
		
		JLabel fragezeichenLabel = new JLabel("");
		fragezeichenLabel.setIcon(new ImageIcon(Bluebook.class.getResource("/ressources/fragezeichen.png")));
		
		JCheckBox chckbxNewCheckBox = new JCheckBox("Testen findet Fehler in der Spezifikation");
		
		JCheckBox chckbxTestenFindetUnterschiede = new JCheckBox("Testen findet Unterschiede zwischen Spezifikation und Implementierung");
		
		JCheckBox chckbxDreiFehlerquellenSind = new JCheckBox("Drei Fehlerquellen sind Spezifikation, Umsetzung und Test");
		
		JCheckBox chckbxTestenVerbesserDie = new JCheckBox("Testen verbesser die Qualit\u00E4t der Software");
		
		JPanel panel = new JPanel();
		panel.setBackground(SystemColor.textHighlight);
		
		JButton btnNchsteFrage = new JButton("N\u00E4chste Frage");
		
		JTextPane txtpnBewertenSieKorrektheit = new JTextPane();
		txtpnBewertenSieKorrektheit.setFont(new Font("Tahoma", Font.BOLD, 11));
		txtpnBewertenSieKorrektheit.setText("Bewerten Sie Korrektheit der folgenden Aussagen bez\u00FCglich Softwaretests:");
		GroupLayout groupLayout = new GroupLayout(frame.getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(55)
							.addComponent(chckbxTestenFindetUnterschiede, GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(55)
							.addComponent(chckbxDreiFehlerquellenSind, GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE))
						.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
							.addContainerGap()
							.addComponent(logoLabel)
							.addGap(282))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(55)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(panel, GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
								.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
									.addComponent(txtpnBewertenSieKorrektheit, GroupLayout.PREFERRED_SIZE, 341, GroupLayout.PREFERRED_SIZE)
									.addPreferredGap(ComponentPlacement.UNRELATED)
									.addComponent(fragezeichenLabel))
								.addGroup(groupLayout.createSequentialGroup()
									.addPreferredGap(ComponentPlacement.RELATED)
									.addComponent(chckbxNewCheckBox, GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE))
								.addComponent(chckbxTestenVerbesserDie, GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE))))
					.addGap(36))
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap(373, Short.MAX_VALUE)
					.addComponent(btnNchsteFrage)
					.addGap(44))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addComponent(logoLabel, GroupLayout.PREFERRED_SIZE, 112, GroupLayout.PREFERRED_SIZE)
					.addGap(13)
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addComponent(fragezeichenLabel)
						.addComponent(txtpnBewertenSieKorrektheit, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE))
					.addGap(11)
					.addComponent(panel, GroupLayout.PREFERRED_SIZE, 4, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addComponent(chckbxNewCheckBox)
					.addGap(18)
					.addComponent(chckbxTestenFindetUnterschiede)
					.addGap(18)
					.addComponent(chckbxDreiFehlerquellenSind)
					.addGap(18)
					.addComponent(chckbxTestenVerbesserDie)
					.addGap(29)
					.addComponent(btnNchsteFrage)
					.addGap(96))
		);
		frame.getContentPane().setLayout(groupLayout);
		
		JMenuBar menuBar = new JMenuBar();
		frame.setJMenuBar(menuBar);
		
		JMenu dataMenuItem = new JMenu("Data");
		menuBar.add(dataMenuItem);
		
		JMenuItem importMenuItem = new JMenuItem("Import");
		dataMenuItem.add(importMenuItem);
		
		JMenuItem exportMenuItem = new JMenuItem("Export");
		dataMenuItem.add(exportMenuItem);
		
		JMenuItem closeMenuItem = new JMenuItem("Close");
		dataMenuItem.add(closeMenuItem);
		
		JMenu refactorMenuItem = new JMenu("Category");
		menuBar.add(refactorMenuItem);
		
		JCheckBox questionMenuCheckbox = new JCheckBox("Questions");
		questionMenuCheckbox.setSelected(true);
		refactorMenuItem.add(questionMenuCheckbox);
		
		JCheckBox glossarMenuCheckbox = new JCheckBox("Glossar");
		refactorMenuItem.add(glossarMenuCheckbox);
		
		JCheckBox definitionMenuCheckbox = new JCheckBox("Definiton");
		refactorMenuItem.add(definitionMenuCheckbox);
		
		JMenu helpMenuItem = new JMenu("Help");
		menuBar.add(helpMenuItem);
		
		JMenuItem functionMenuItem = new JMenuItem("Functionality");
		helpMenuItem.add(functionMenuItem);
		
		JMenuItem aboutMenuItem = new JMenuItem("About");
		helpMenuItem.add(aboutMenuItem);
	
	}





}
